package com.atguigu.day11.exer.area;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/12 10:37
 * @注释
 */
public class Rectangle extends Graphic {
    private int width;
    private int length;

    @Override
    public double area() {
        return length * width;
    }

    @Override
    public double perimeter() {
        return 2 * (length + width);
    }

    @Override
    public String getInfo() {
        return "长：" + length + ", 宽：" + width + super.getInfo();
    }

    public Rectangle() {
    }

    public Rectangle(int width, int length) {
        this.width = width;
        this.length = length;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }
}
